package com.suxin;

import com.suxin.rpc.CtRpc;
import com.suxin.rpc.TokenRpc;
import com.suxin.rpc.domain.DiagnosisRpcQueryDto;
import com.suxin.rpc.domain.LoginRpcQuery;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

import javax.annotation.Resource;

/**
 * @Classname Application
 * @Description [ Application ]
 * @Author Tang
 * @Date 2020/11/18 11:01
 * @Created by ASUS
 */
@EnableFeignClients
@SpringBootApplication
public class Application implements CommandLineRunner {

    public static void main(String[] args) {

        SpringApplication.run(Application.class, args);

    }

    @Resource
    CtRpc ctRpc;

    @Resource
    TokenRpc tokenRpc;

    @Resource
    LoginRpcQuery loginRpcQuery;

    @Override
    public void run(String... args) throws Exception {

        System.out.println(tokenRpc.getData(loginRpcQuery).toJSONString());

        DiagnosisRpcQueryDto diagnosisRpcQueryDto = new DiagnosisRpcQueryDto();
        diagnosisRpcQueryDto.setVin("001");
        diagnosisRpcQueryDto.setDateBegin("2021-09-10");
        diagnosisRpcQueryDto.setDateEnd("2021-09-14");
        System.out.println(ctRpc.getData(diagnosisRpcQueryDto).toJSONString());
    }
}